import {systemServer} from '../baseApi'

export class fileApi {
  static upload(data =[], files = []) {
    return systemServer.connection('POST', '/sys/file/upload', data, files, 'files')
  }
  static uploadAvatar(data = [], files = []) {
    return systemServer.connection('POST', '/sys/file/avatar/upload', data, files, 'files')
  }
  static download(data) {
    return systemServer.connection('GET', '/sys/file/downloadFile', data)
  }
  static findPage (data) {
    return systemServer.connection('POST', '/sys/file/findPage', data)
  }

  static delete(data) {
    return systemServer.connection('POST', '/sys/file/delete', data)
  }

  static findByName(data) {
    return systemServer.connection('GET', '/sys/file/findByName', data)
  }
}
